Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDM: fix setGain() for dfsdm #948

Merged
merged 1 commit into from
Sep 2, 2024
Merged

Conversation

facchinm
Copy link
Member

@facchinm facchinm commented Sep 2, 2024

If the gain was too high, the right bit shift
RecBuff[i] >> attenuation
would result in undefined behaviour
https://www.iso-9899.info/n1570.html#6.5.7

Take the chance to also fix the (approximate) conversion from gain (in dB) to bit shift

If the gain was too high, the right bit shift
  RecBuff[i] >> attenuation
would result in undefined behaviour
https://www.iso-9899.info/n1570.html#6.5.7

Take the chance to also fix the (approximate) conversion from gain (in dB) to bit shift
@d-le0
Copy link

d-le0 commented Sep 2, 2024

All good!
Also the behavior of setGain is intuitive.

@facchinm facchinm merged commit 92eaf0e into arduino:main Sep 2, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants